package com.ac.common.core.exception.config;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author : 小凡
 * date : create in 2021/7/22 14:48
 * description :
 **/
@Getter
public enum ExceptionType implements Serializable {

    System_Error(10000, "系统错误"),


    /***
     * 参数
     */
    Parameter_Error(10100, "入参错误"),


    /***
     * Token
     */
    Token_Invalid(10200, "Token无效"),
    Token_Not_Found(10201, "缺失Token | 未登录"),
    Token_Expire(10202, "token过期"),

    Code_Not_Found(10300, "未发送验证码"),
    Code_Mismatch(10301, "验证码不匹配"),
    Code_Error_Count_Gt_5(10302, "验证码错误五次"),
    Code_Error_Time_Out(10303, "验证码超时"),

    /***
     * Password
     */
    Password_Error(10302, "密码错误"),
    Password_Error_Count_Gt_5(10302, "密码错误五次"),

    /***
     *  Card
     */
    Card_Not_Found(10400, "卡密不存在"),

    /***
     *  Account
     */
    Has_Account(10500, "拥有账号"),


    Has_Other_Data(10600,"重复添加");

    @Setter
    private int code;
    private String message;

    ExceptionType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ExceptionType of(String message) {
        this.message = message;
        return this;
    }


}
